#-*- codeing = utf-8 -*-
#@Time : 2020/9/20 16:24
#@Author : 阳某
#@File : 正则_字典加引号.py
#@Software : PyCharm

import re

headers_str = '''
word: 欧阳
sizes: 60
fonts: yqk.ttf
fontcolor: #000000
'''
pattern = '^(.*?): (.*)$'
for line in headers_str.splitlines():
    print(re.sub(pattern,'\'\\1\':\'\\2\',',line))